package com.shiro.dao.impl;

import com.shiro.dao.MenuIconDao;
import com.shiro.mapper.MenuIconMapper;
import com.shiro.model.MenuIcon;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

/**
 * Created by zhb on 2017/12/4.
 */
@Service("menuIconDao")
public class MenuIconDaoImpl implements MenuIconDao {
    @Autowired
    MenuIconMapper menuIconMapper;

    @Override
    public List<MenuIcon> selectInconAll() {
        Example example = new Example(MenuIcon.class);
        example.setOrderByClause("time desc");
        return menuIconMapper.selectByExample(example);
    }

    @Override
    public void del(MenuIcon menuIcon) {
        menuIconMapper.delete(menuIcon);
    }

    @Override
    public void add(MenuIcon menuIcon) {
        menuIconMapper.insert(menuIcon);
    }
}
